#include "common.hpp"

int main()
{
  // 获取共享内存和挂接到进程地址空间
  int shmid = getShm();
  char *shmaddr = (char *)shmat(shmid, nullptr, 0);
  // IPC通信
  while (true)
  {
    cout << "Please enter@ ";
    fgets(shmaddr, size, stdin);
  }

  // 取消挂接和释放共享内存
  shmdt(shmaddr);
  shmctl(shmid, IPC_RMID, nullptr);
  return 0;
}